<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
    >

    <ui:composition 
         
      
        template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.InvoiceTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:form styleClass="jsfcrud_list_form">
                <h:panelGroup id="messagePanel" layout="block">
                    <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
                </h:panelGroup>
                <h:outputText escape="false" value="#{bundle.ListProjectsEmpty}" rendered="#{projectsController.timeLogSheetData.rowCount == 0}"/>
                <h:panelGroup id ="panelSearch" rendered="#{projectsController.timeLogSheetData.rowCount > 0}">
                    <h:outputText value="#{projectsController.pagination.pageFirstItem + 1}..#{projectsController.pagination.pageLastItem + 1}/#{projectsController.pagination.itemsCount}"/>&nbsp;
                    <h:commandLink action="#{projectsController.previous}" value="#{bundle.Previous} #{projectsController.pagination.pageSize}" rendered="#{projectsController.pagination.hasPreviousPage}"/>&nbsp;
                    <h:commandLink action="#{projectsController.next}" value="#{bundle.Next} #{projectsController.pagination.pageSize}" rendered="#{projectsController.pagination.hasNextPage}"/>&nbsp;
                    <h:dataTable   value="#{projectsController.timeLogSheetData}" var="item" border="0" cellpadding="2" cellspacing="0" rowClasses="jsfcrud_odd_row,jsfcrud_even_row" rules="all" style="border:solid 1px">
                     <h:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.InvoiceTitle_timeSheet}"/>
                            </f:facet>
                    <h:outputText value="#{item.projectName}"/>
                    <br />
                     <ui:repeat value="#{item.timelogList}" var="log">
                         &brvbar; &rArr;
                         
                 <h:outputText value="     #{log.workedHours} -----#{log.status}" />  
                  <h:selectBooleanCheckbox value="#{log.included}" />
                   <br/>
                         </ui:repeat>  
                        </h:column>
                        <h:column>
                        <f:facet name="header">
                                <h:outputText value="#{bundle.InvoiceLabel_expense}"/>
                            </f:facet>
                              <ui:repeat value="#{item.invoice_Expenses}" var="exp">
                         &brvbar; &rArr;
                         
                 <h:outputText value="     #{exp.type} -----#{log.status}" />  
                 <h:selectOneRadio value="#{exp.included}" />
                 <h:selectOneRadio value="#{exp.reject}" />
                 <h:selectOneRadio value="#{exp.delete}" />
                   <br/>
                         </ui:repeat> 
                            </h:column>
                    </h:dataTable>
                </h:panelGroup>
                <br />
                <h:commandLink action="#{projectsController.prepareCreate}" value="#{bundle.ListProjectsCreateLink}"/>
                <br />
                <br />
         
                <h:commandButton value="submit" action="#{projectsController.submitinvoice_timeSheet}" />
            </h:form>
        
 
            
        </ui:define>
     
    </ui:composition>

</html>
